function queryUsersByParams() {
    $("#dg").datagrid("load",{
        userName:$("#userName").val(),
        mobile:$("#mobile").val()
    })
}

function openAddUserDialog() {
    openDlg("dlg","添加用户");
}
function openModifyUserDialog() {
    openModifyDlg("dg","fm","dlg","修改用户信息");
}
function deleteUser() {
    deleteData("dg","deleteUser",queryUsersByParams);
}

function saveOrUpdateUser() {
    var id = $("#id").val();
    var submitUrl = "saveUser";
    if(!isEmpty(id)){
        submitUrl="updateUser";
    }
    saveOrUpdate("fm",submitUrl,"dlg",queryUsersByParams);
}
function closeUserDlg() {
    initFormData("fm");
    closeDlgData("dlg");
}